//
//  MyInviteVC.m
//  doubleEduStudents
//
//  Created by 盛洋 on 2021/1/12.
//  Copyright © 2021 shengYang. All rights reserved.
//

#import "MyInviteVC.h"

@interface MyInviteVC ()
@property (strong, nonatomic) IBOutlet UIImageView *erCode_img;
@property (strong, nonatomic) IBOutlet UILabel *share_lab;
@property (strong, nonatomic) IBOutlet UILabel *invite_lab;
@property (strong, nonatomic) IBOutlet UILabel *http_lab;
@property (strong, nonatomic) IBOutlet UIButton *share_btn;
@property (strong, nonatomic) IBOutlet UILabel *tel_lab;

@end

@implementation MyInviteVC
{
    RequestServices *service;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"我的邀请";
    [self.backKuang setHidden:YES];
    [self showBackCenterKuang:[UIImage imageNamed:@"back_center"]];
    self.erCode_img.hidden=self.invite_lab.hidden = self.http_lab.hidden = self.share_btn.hidden = YES;
    APPViewBorderRadius(self.http_lab, 5, .5, [UIColor colorWithHexString:Select_line_Color]);
    self.share_lab.font  = self.share_btn.titleLabel.font =  self.tel_lab.font = self.invite_lab.font = self.http_lab.font = AutoLabFont2;
    service.view = self.view;
    service = [[RequestServices alloc]initWithDelegate:self];
    [service getInviteHttp:8000];
}

#pragma mark - requestDelegate
-(void)getFinished:(NSDictionary *)obj tag:(long long)tag{
    [self HideLoading];
    self.erCode_img.hidden=self.invite_lab.hidden = self.http_lab.hidden = self.share_btn.hidden = NO;
    self.invite_lab.text = @"邀请码";
    self.share_lab.text = @"邀请好友扫码下载app并注册可得积分";
    self.http_lab.text = [NSString stringWithFormat:@"%@",obj[@"url"]];
    [self.erCode_img sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",obj[@"qr"]]]];
}

-(void)getError:(NSError *)error tag:(long long)tag{
    [self ShowNewMsg:error.domain];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
